package com.gmail.liulijuan.Busyness;

import java.util.ArrayList;

import com.gmail.liulijuan.DB.Deal;
import com.gmail.liulijuan.DB.DealDao;
import com.gmail.liulijuan.DB.Employee;
import com.gmail.liulijuan.DB.EmployeeDao;

public class DealList {
	public String[][] initDealList(){
		ArrayList al=new ArrayList();
		DealDao dd=new DealDao();
		al=dd.getAllDeal();
		String[][] deal=new String[al.size()][11];
		for (int i = 0; i <al.size(); i++) {
			deal[i][0]=String.valueOf(((Deal)(al.get(i))).getID());
//			deal[i][1]=String.valueOf(((Deal)(al.get(i))).getCustomID());
			deal[i][2]=((Deal)(al.get(i))).getCustomName();
			deal[i][3]=String.valueOf(((Deal)(al.get(i))).getTime());
//			deal[i][4]=String.valueOf(((Deal)(al.get(i))).getCustomID());
			deal[i][5]=((Deal)(al.get(i))).getEmployeeName();
			deal[i][6]=((Deal)(al.get(i))).getService1();
			deal[i][7]=((Deal)(al.get(i))).getService2();
			deal[i][8]=((Deal)(al.get(i))).getAssistant();
			deal[i][9]=String.valueOf(((Deal)(al.get(i))).getPrice());
			deal[i][10]=((Deal)(al.get(i))).getComments();
			
		}
		return deal;
		
	}
	public String[] initColumTitle(){
		String[] tt={"ID","CustomID","CustomName","Time","EmployeeID","EmployeeName","Service1","Service2","Assistant","Price","Comments"};
		return tt;
			
		
	}
	
	public ArrayList getAllDeal(){
		DealDao dd=new DealDao();
		return dd.getAllDeal();
		
	}

}
